/*真伪查询区逻辑代码
----------------------------------------------------------------*/

/*验证码验证区
----------------------------------------------------------*/
//获取类名为 input02 的输入框元素
var oInput02 = document.querySelector(".input02");

//获取包裹验证信息元素
var oDesc = document.querySelector(".desc");

//添加光标离开事件,对验证码进行验证
myAddEvent(oInput02, 'blur', function (params) {
    if (this.value === "") {
        console.log("验证码不能为空");
        oDesc.innerHTML = "验证码不能为空";
    } else {
        oDesc.innerHTML = "";
    }
})


/*更换验证码图片区
----------------------------------------------------------*/

//获取更换验证码的点击按钮
var oChangeImgBtnClick = document.querySelector(".changeImgBtnClick");

var contentWrapperForm = document.querySelector(".content-wrapper form");

// var contentWrapperImg = contentWrapperForm.getElementsByTagName("img")[0];

myAddEvent(oChangeImgBtnClick, 'click', function (params) {
    console.log(this.innerHTML)
    var contentWrapperImg = contentWrapperForm.getElementsByTagName("img")[0];
    contentWrapperForm.removeChild(contentWrapperImg);
    var oImg = document.createElement('img');
    oImg.src = "https://www.nubia.com/profile.php?a=captcha&ram=0.5370781771776076";
    contentWrapperForm.insertBefore(oImg,oChangeImgBtnClick);

    
})